// 引用文件路径
const path = require('path')
// 引用craco-less
const CracoLessPlugin = require('craco-less')
module.exports = {
	webpack: {
		// 别名
		alias: {
			'@': path.resolve('src'),
		},
	},
	//配置代理解决跨域
	devServer: {
		proxy: {
			'/api': {
				target: 'http://www.asks.com/api',
				changeOrigin: true,
				pathRewrite: {
					'^/api': '',
				},
			},
		},
	},
	//配置less
	plugins: [
		{
			plugin: CracoLessPlugin,
			options: {
				lessLoaderOptions: {
					lessOptions: {
						javascriptEnabled: true,
					},
				},
			},
		},
	],
}
